export default {
    namespaced: true,
    state: {
        isShowToast: false,
        toastMsg: '手机号',
        toastType: '类型'
    },
    mutations: {
        // 修改isShowToast的方法
        changeIsShowToast(state, payload) {
            // state.isShowToast = payload.isshow;
            // if (payload.isshow) {
            //     state.toastMsg = payload.msg;
            //     state.toastType = payload.type;
            // }
            state.isShowToast = payload.isshow;
            if (payload.isshow) {
                state.toastMsg = payload.msg;
                state.toastType = payload.type;
            }
        }
    },
    actions: {
        asyncChangeIsShowToast(context, payload) {
            // console.log(111);
            context.commit('changeIsShowToast', payload);
            setTimeout(() => {
                context.commit("changeIsShowToast", {
                    isshow: false
                })
            }, 1500);
        }
    }
}